package cn.com.headfree.log.service.impl;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gta.edu.sdk.base.service.impl.BaseServiceImpl;
import com.gta.edu.sdk.common.dto.ChartDto;
import com.gta.edu.sdk.common.dto.Page;
import com.gta.edu.sdk.common.dto.Sort;
import com.gta.edu.sdk.log.entity.TLogWarn;
import com.gta.edu.sdk.log.entity.TSysLogInfo;

import cn.com.headfree.log.dao.ILogDao;
import cn.com.headfree.log.dto.ChartLogDto;
import cn.com.headfree.log.service.ILogService;

@Service("logService")
public class LogServiceImpl extends BaseServiceImpl<TSysLogInfo> implements ILogService {

	@Autowired
	private ILogDao logDao;
	
	@Override
	public void saveLogRecord(List<?> logRecords) {
		this.logDao.saveLogRecord(logRecords);
	}

	@Override
	public void findPageLog(TSysLogInfo logInfo,Date startTime,Date endTime, Sort sort, Page<TSysLogInfo> page) {
		this.logDao.findPageLog(logInfo, startTime, endTime, sort, page);
	}

	@Override
	public List<ChartDto> logOpSummary(String sysCode, Date startTime, Date endTime) {
		return this.logDao.logOpSummary(sysCode, startTime, endTime);
	}

	@Override
	public List<ChartLogDto> logOpExceptionSummary(String sysCode, Date startTime, Date endTime) {
		return this.logDao.logOpExceptionSummary(sysCode, startTime, endTime);
	}
	
	@Override
	public int getLogRecordNum() throws SQLException {
		return this.logDao.getLogRecordNum();
	}

	@Override
	public void findPageLogWarn(Sort sort, Page<TLogWarn> page) {
		this.logDao.findPageLogWarn(sort, page);
	}

	@Override
	public void logBack(Date limitDate,int flag) {
		this.logDao.logBack(limitDate,flag);
	}
	
	@Override
	public void clearRecord() {
		this.logDao.clearRecord();
	}
}
